package com.yitong.base.domain;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;

/**
 * 常量类
 * 
 * @author Administrator
 * 
 */
public class Constant {

	public static final int DEFAULT_PAGE_SIZE = 15;
	
	public static final int DEFAULT_PAGE_SIZE_SITE = 8;

	public static final String NET_ERROR = "网络不稳定";

	public static final String USER_SESSION = "PRIVATE_USER_SESSION";
	
	
	
	
	
	
	
	
	
	

	/**
	 * 分页操作的常量
	 */
	public static final int NUMPERPAGE = 20;
	public static final int PAGENUMSHOWN = 10;

	public static List<?> list = new ArrayList<>();
	public static Map<Object, Properties> propMap = new HashMap<Object, Properties>();

	/*** 数据库操作类 **/
	public final static String INSERT_ERR_MSG = "对数据库执行插入时错误!";
	public final static String UPDATE_ERR_MSG = "对数据库执行修改时错误!";
	public final static String DELETE_ERR_MSG = "对数据库执行删除时错误!";
	public final static String LOAD_ERR_MSG = "对数据库执行查询单条记录时错误!";
	public final static String FIND_ERR_MSG = "对数据库执行查询多条记录时错误!";
	public final static String EXISTS_ERR_MSG = "对数据库执行判断记录是否存在时错误!";
	public final static String COUNT_ERR_MSG = "对数据库执行查询记录数时错误!";

	public final static String MSG_Exception = "{\"error\":\"没有找到相关的数据\"}";

	/**
	 * 拦截器常量
	 */
	public static final String INTERCEPTOR_CLEANUP = "cleanup_recursion_counter";
	public static final String INTERCEPTOR_ACTION_MAPPING = "struts.actionMapping";
	public static final String INTERCEPTOR_VALUE_STACK = "struts.valueStack";

	// 找到某一个菜单下所有菜单的接口
	public static String RIGHT_SUB_ACTION = "rightSub.action?";
	public static String MESSAGE_CODE = "code";
	public static String MESSAGE_INFO = "info";
	public static String MESSAGE_MESSAGE = "message";

	// 获得当前登录用户下所有用户接口 根据orgId查询
	public static String USER_LIST_BY_ORGID_ACTION = "userListByOrgId.action?";
	// 权限项目的用户登录接口
	public static String USERLOGIN_ACTION = "userLogin.action?";
	public static String URL_SPLIT = "&";
	public static String SESSION_LOGIN_USER = "SESSION_LOGIN_USER";
	public static String SESSION_LOGIN_USER_ORG = "SESSION_LOGIN_USER_ORG";
	// 权限项目的用户登陆后，找到最顶级菜单接口
	public static String USER_RRIGHT_TOP_ACTION = "userRightTop.action?";

	/**
	 * 最大文件长度10M
	 */
	public final static Long MAX_FILE_SIZE = 10 * 1024 * 1024L;

	/**
	 * 最大文件长度10M
	 */
	public final static String ERROR_FILE_SIZE = "文件大小不能超过10M";

	/**
	 * 文件格式不正确
	 */
	public final static String ERROR_FILE_TYPE = "文件格式不支持";

	/**
	 * excel上传文件格式
	 */
	public final static String[] EXCEL_FILE_CONTENT = { "xls", "xlsx" };

	/**
	 * 图片上传文件格式
	 */
	public final static String[] PICTURE_FILE_CONTENT = { "jpg", "png", "jpeg", "JPG", "PNG", "JPEG" };

	/**
	 * 上传成功
	 */
	public final static String UPLOAD_SUCCESS = "UPLOAD_SUCCESS";

	/**
	 * 上传-文件大小超过限制
	 */
	public final static String UPLOAD_FAIL_SIZE = "UPLOAD_FAIL_SIZE";

	/**
	 * 上传-文件格式不正确
	 */
	public final static String UPLOAD_FAIL_CONTENT = "UPLOAD_FAIL_CONTENT";

	/**
	 * 上传图片的文件夹名称1
	 */
	public final static String UPLOAD_PICTURE_FILE = "photo";
	
	/**
	 * 上传图片的文件夹名称2
	 */
	public final static String UPLOAD_PICTURE_EDITOR = "editor";

	  public static final String LOCAL_SAVEPATH = "D:"+File.separatorChar+File.separatorChar;
	  public static final String LINUX_SAVEPATH = File.separatorChar+"mnt"+File.separatorChar+"resource"+File.separatorChar;
	  public static final String NORIMG_PATH = "upload/" + "imageD/";
	  public static final String EDITIMG_PATH = "upload/" + "editorD/" ;
}
